//
//  CCMOrderItemCollectionViewCell.swift
//  CCMoney_swift
//
//  Created by JKHuang on 2018/11/27.
//  Copyright © 2018 JKHuang. All rights reserved.
//

import UIKit

class CCMOrderItemCollectionViewCell: UICollectionViewCell {
    
    lazy var titleLabel:UILabel = {
        let label = UILabel()
        label.textColor = UIColor.white
        label.font = UIFont.systemFont(ofSize: 12)
        return label
    }()
    
    lazy var iconImage:UIImageView = {
        let image = UIImageView()
        return image
    }()
    
    override init(frame: CGRect) {
        super.init(frame:frame)
        setUI()
        self.backgroundColor = UIColor.hex(0x2D3554)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

extension CCMOrderItemCollectionViewCell{
    
    fileprivate func setUI(){
        
        self.contentView.addSubview(self.titleLabel)
        self.contentView.addSubview(self.iconImage)
        
        self.iconImage.snp.makeConstraints { (make) in
            make.centerX.equalTo(self.contentView)
            make.top.equalTo(self.contentView).offset(15)
        }
        
        self.titleLabel.snp.makeConstraints { (make) in
            make.top.equalTo(self.iconImage.snp_bottomMargin).offset(15)
            make.centerX.equalTo(self.contentView)
        }
    }
}
